package com.firesrc.mail.search;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

import jodd.util.StringUtil;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class SearchMailWhois365Impl extends AbstractSearchMail {

	@Override
	public Set<String> getMailListFromUrl(String url) {
		try {
			Document doc = Jsoup.connect("http://www.whois365.com/tw/domain/" + url).userAgent("i as info")
					.cookie("auth", "token").timeout(10000).get();
			String text = doc.text();
			text = StringUtil.replace(text, " (a) ", "@");
			return getMailListFromText(text);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("连接网站whiso365 出现错误,分析的网址是:" + url);
		}
		return new HashSet<String>();
	}

}
